Skip to content

Fix/login 403 logged in and 401 when not logged in#711

Open
SharonStrats wants to merge 23 commits intopost-milestone3mfrom
fix/login-403-logged-in
Open

Fix/login 403 logged in and 401 when not logged in#711
SharonStrats wants to merge 23 commits intopost-milestone3mfrom
fix/login-403-logged-in

Conversation

@SharonStrats
Copy link
Copy Markdown
Contributor

I get all these red 403 and 401 errors when I'm

  1. Logged in I get the 403 error
  2. when I'm logged out I get 401

these are quite confronting, this is an attempt at messaging instead of the confronting errors.

Copilot AI review requested due to automatic review settings March 15, 2026 20:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses the confusing 401 and 403 error messages displayed to users when they are logged out (401) or logged in but lack permissions (403). Instead of showing alarming alert() popups and throwing errors, the code now logs friendlier messages and gracefully continues execution.

Changes:

  • In ensureLoadedPreferences, the 401/unauthorized handling now sets a warning and returns context instead of showing an alert, and adds regex-based fallback matching for error messages.
  • In ensureLoadedProfile, the function no longer throws when the user is not logged in; instead it logs a message and returns context. Additionally, 403/forbidden and cancel errors during profile loading are treated as non-fatal when the user is already authenticated.
  • Error message display in ensureLoadedProfile's catch block is updated to use a safely extracted message string instead of accessing err.message directly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/login/login.ts Outdated
Comment thread src/login/login.ts Outdated
Comment thread src/login/login.ts Outdated
Comment thread src/login/login.ts Outdated
@SharonStrats SharonStrats changed the base branch from main to post-milestone3m May 4, 2026 23:59
@SharonStrats SharonStrats changed the base branch from post-milestone3m to main May 5, 2026 00:01
@SharonStrats SharonStrats changed the base branch from main to post-milestone3m May 5, 2026 00:02
SharonStrats and others added 5 commits May 5, 2026 10:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/login/login.ts
Comment thread src/login/login.ts
Comment thread src/login/login.ts Outdated
Comment thread src/login/login.ts Outdated
Comment thread src/login/login.ts
SharonStrats and others added 4 commits May 5, 2026 10:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/login/login.ts Outdated
Comment thread src/login/login.ts
Comment thread src/login/login.ts
Comment thread src/login/login.ts
SharonStrats and others added 2 commits May 5, 2026 11:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…gedInProfile

Agent-Logs-Url: https://github.com/SolidOS/solid-ui/sessions/b4ca60b7-29b9-4e38-b679-9657c19bc7b0

Co-authored-by: SharonStrats <9412507+SharonStrats@users.noreply.github.com>
…eferences catch block

Agent-Logs-Url: https://github.com/SolidOS/solid-ui/sessions/4b8e8c78-2b47-40ca-b1f3-fe0bf78f8017

Co-authored-by: SharonStrats <9412507+SharonStrats@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants